app1= new Vue
  el:"#app1"
  data:
    message:""
    # 匹配手机端浏览器
    device_array:[{key:/ipad/i,value:"ipad"},{key:/iphone os/i,value:"iphone os"},{key:/midp/i,value:"midp"},
        {key:/rv:1.2.3.4/i,value:"rv:1.2.3.4"},{key:/ucweb/i,value:"ucweb"},
        {key:/android/i,value:"android"},{key:/windows ce/i,value:"windows ce"},
        {key:/windows mobile/i,value:"windows mobile"}]
    e:"PC"
    n:""
    i:0
    u:""
    a:""
    device_type:""
    offerList:[]
  methods:
    # 判断浏览器类型
    device:()->
      self = @
      self.u = navigator.userAgent.toLowerCase()
      self.n = self.device_array.length
      for item in self.device_array
        self.a = self.u.match(item.key)
        if self.a instanceof Array
          self.a = self.a[0]
        if self.a==item.value
          self.e = "PHONE"
          break
      return self.e
  mounted:()->
    self = @
    self.device_type = self.device()
    # 查询投资期限分数优惠幅度表
    self.$http.get("http://my.gf.com.cn:8091/query_tzqx_rate")
      .then (res)->
        self.offerList = res?.data

        console.log res

    console.log(self.device_type)
    
